package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-10-17  10:30
 */
public class Cylinder extends Circle{
    protected double h;
    private static int i = 1;
    public Cylinder(double x, double y, double r, double h) {
        super(x, y, r);
        this.h = h;
    }

    public double getH() {
        return h;
    }

    public void setH(double h) {
        this.h = h;
    }
    public double bulk() {
        double bulk = super.circleArea() * h;
        return bulk;
    }
    public void display() {
        System.out.println("Cylinder" + i + ":" + "位置坐标：X:" + super.x + " Y:" + super.y + " 圆的半径：" + super.r + " 圆柱的体积：" + this.bulk());
        i++;
    }
}
